Page({
    data: {

    },
    onLoad: function () {
        // 监听页面加载的生命周期函数
        let news;
        for (let i = 0; i < getApp().globalData.config.length; i++) {
            if (getApp().globalData.config[i].key == 'news') {
                news = getApp().globalData.config[i];
                break;
            }
        }
        getApp().rq('/Index/getList', {
            typeid: news.alis,
            limit: 999,
            sort: news.sortname,
        }).then(res => {
            this.setData({
                data: res.data,
                imageurl: getApp().globalData.imageurl
            })
        })
    },
    newsDetail(e) {
        var that = this;
        var info = e.currentTarget.dataset.info;
        swan.setStorageSync('prodetail', info);
        swan.navigateTo({
            url: '../productDetail/productDetail'
        });
    },
});